<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import ="java.sql.DriverManager" %>
<%@ page import ="java.sql.Connection" %>
<%@ page import ="java.sql.Statement" %>
<%@ page import ="java.sql.ResultSet" %>
<%@ page import ="java.sql.SQLException" %>
<%
String memberID = request.getParameter("memberID");

Class.forName("com.mysql.jdbc.Driver");
String name="";
String email="";
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;

try{
	String jdbcDriver ="jdbc:mysql://192.168.0.200:3306/intra?useUnicode=true&characterEncoding=utf-8";
	String dbUser = "root";
	String dbPass = "ice1234";
	
	String query = "SELECT * FROM MEMBER WHERE MEMBERID='"+memberID+"'";
	conn = DriverManager.getConnection(jdbcDriver,dbUser,dbPass);
	stmt = conn.createStatement();
	rs = stmt.executeQuery(query);
	if(rs.next()){
		name = rs.getString("NAME");
		email = rs.getString("EMAIL");
	}
}finally{
	if(rs != null) try{rs.close();}catch(SQLException ex){}
	if(stmt != null) try{stmt.close();}catch(SQLException ex){}
	if(conn != null) try{conn.close();}catch(SQLException ex){}
}
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<table border="1">
	<tr>
		<td>이름</td>
		<td><%=name%></td>
	</tr>
	<tr>
		<td>아이디</td>
		<td><%=memberID%></td>
	</tr>
	<tr>
		<td>이메일</td>
		<td><%=email%></td>
	</tr>
	</table>
</body>
</html>